#include<stdio.h>
#include<algorithm>
long int a[2000000];
int n1,n2;
int main(void){
  scanf("%d",&n1);
  int i=0;
  while(i<n1){
    scanf("%ld",&a[i]);
    i++;
  }
  scanf("%d",&n2);
  while(i<n1+n2){
    scanf("%ld",&a[i]);
    i++;
  }
  std::sort(a,a+n1+n2);
  int medianIndex=(n1+n2-1)/2;
  printf("%ld",a[medianIndex]);
  return 0;
}
